function [ftpf,tspf,tsxz,ftxz] = pf_xz(a,b,R,h,L)
%   PF_XZ 计算固定尺寸等极孔芯模测地线的铺放角与旋转角
%   如果需要不等极孔非测地线请联系长春理工大学王菲老师
%   需要输入椭圆封头芯模长轴a，椭圆封头芯模短轴b，筒身段半径R,封头高度h,筒身长度L
%   本次项目所用芯模尺寸 a=77.5;b=a/2;R=a;h=27.795;L=155;
%% 
% 芯模封头与筒身段铺放角
% 母线方程
y = 0:h/45:h;
r = a/b*sqrt(b^2-(y-h).^2).*(0<=y&y<=h);
% 极孔半径
c=r(1);
% 筒身铺放角
tspf = rad2deg(asin(c/R));
% 封头铺放角序列
ftpf = real(rad2deg(asin(R*sin(deg2rad(tspf))./r)))';
ftpf=flip(ftpf);
%%
% 芯模筒身段旋转角
tsxz = (L*tan(deg2rad(tspf))/(2*pi*R))*360;
% 芯模封头段旋转角
x=r;
x(1)=r(1)+0.001;
x(end)=r(end)+0.001;
n=length(x);
ftxz=zeros(1,n);
for i=1:n
fun= @(r)(c*sqrt(1+((b.*r)./(R^2.*sqrt(1 - r.^2/R^2))).^2)./(r.*sqrt(r.^2-c^2)));
xt=rad2deg(integral(fun,c,x(i)));
ftxz(i)=real(xt);
end
end

